﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class Resource : IDisposable
{
    private bool available;
    private int value;

    public int Value
    {        
        get { return this.value; }
    }

    public bool Available
    {
        get { return available; }
        set { this.available = value; }
    }

    public Resource(int val)
    {
        this.available = true;
        this.value = val;
    }

    ~Resource()
    {
        Dispose(false);
    }
    
    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    private void Dispose(bool disposing)
    {
        if (disposing)
        {
            this.available = true;
        }

        this.available = true;
    }
}
